package com.ruoyi.ctcx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ctcx.domain.ro.InsuranceParam;
import com.ruoyi.ctcx.domain.ro.RiskParam;
import com.ruoyi.ctcx.domain.vo.TbInsuranceRiskAmountVo;
import com.ruoyi.ctcx.domain.vo.TbInsuranceRiskContracStaticstVo;
import com.ruoyi.ctcx.domain.vo.TbInsuranceRiskContractVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ctcx.mapper.TbInsuranceRiskContractMapper;
import com.ruoyi.ctcx.domain.TbInsuranceRiskContract;
import com.ruoyi.ctcx.service.ITbInsuranceRiskContractService;

/**
 * 保险风控合同Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-19
 */
@Service
public class TbInsuranceRiskContractServiceImpl implements ITbInsuranceRiskContractService 
{
    @Autowired
    private TbInsuranceRiskContractMapper tbInsuranceRiskContractMapper;

    /**
     * 查询保险风控合同
     * 
     * @param id 保险风控合同主键
     * @return 保险风控合同
     */
    @Override
    public TbInsuranceRiskContract selectTbInsuranceRiskContractById(Long id)
    {
        return tbInsuranceRiskContractMapper.selectTbInsuranceRiskContractById(id);
    }

    /**
     * 查询保险风控合同列表
     * 
     * @param tbInsuranceRiskContract 保险风控合同
     * @return 保险风控合同
     */
    @Override
    public List<TbInsuranceRiskContract> selectTbInsuranceRiskContractList(TbInsuranceRiskContract tbInsuranceRiskContract)
    {
        return tbInsuranceRiskContractMapper.selectTbInsuranceRiskContractList(tbInsuranceRiskContract);
    }

    /**
     * 新增保险风控合同
     * 
     * @param tbInsuranceRiskContract 保险风控合同
     * @return 结果
     */
    @Override
    public int insertTbInsuranceRiskContract(TbInsuranceRiskContract tbInsuranceRiskContract)
    {
        tbInsuranceRiskContract.setCreateTime(DateUtils.getNowDate());
        return tbInsuranceRiskContractMapper.insertTbInsuranceRiskContract(tbInsuranceRiskContract);
    }

    /**
     * 修改保险风控合同
     * 
     * @param tbInsuranceRiskContract 保险风控合同
     * @return 结果
     */
    @Override
    public int updateTbInsuranceRiskContract(TbInsuranceRiskContract tbInsuranceRiskContract)
    {
        tbInsuranceRiskContract.setUpdateTime(DateUtils.getNowDate());
        return tbInsuranceRiskContractMapper.updateTbInsuranceRiskContract(tbInsuranceRiskContract);
    }

    /**
     * 批量删除保险风控合同
     * 
     * @param ids 需要删除的保险风控合同主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceRiskContractByIds(String[] ids)
    {
        return tbInsuranceRiskContractMapper.deleteTbInsuranceRiskContractByIds(ids);
    }

    /**
     * 删除保险风控合同信息
     * 
     * @param id 保险风控合同主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceRiskContractById(String id)
    {
        return tbInsuranceRiskContractMapper.deleteTbInsuranceRiskContractById(id);
    }

    @Override
    public List<TbInsuranceRiskContractVo> getRiskContractListVo(InsuranceParam insuranceParam) {
        return tbInsuranceRiskContractMapper.getRiskContractListVo(insuranceParam);
    }

    @Override
    public List<TbInsuranceRiskContracStaticstVo> getRiskContractStaticsVo(RiskParam riskParam) {
        return tbInsuranceRiskContractMapper.getRiskContractStaticsVo(riskParam);
    }

    @Override
    public TbInsuranceRiskAmountVo getRiskAmount(RiskParam riskParam) {
        return tbInsuranceRiskContractMapper.getRiskAmount(riskParam);
    }
}
